<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;
class UserController extends Controller
{
    public function getIndex(){
    	// session 获取用户名
    	$username = session('homeindex_username');
    	// session获取用户id
    	// $id = session('home_userid');
    	// // 查询用户的待发货数量
    	// $res = DB::table('tbl_order') -> where('orderstatus','待发货') -> where('uid',70)-> orderBy('orderstatus')-> get();
    	// $res = count($res); 
       $res = DB::table('tbl_house')
       ->join('tbl_goods','tbl_house.gid','=','tbl_goods.id')
       ->get();
       $res1 = DB::table('tbl_goodsrecom')
            -> join('tbl_goods','tbl_goods.id','=','tbl_goodsrecom.gid')
            -> get();
            // dd($res1);
        return view('home.user.index',['username'=>$username,'res'=>$res,'res1'=>$res1]);
    }



    public function getInformation(){
        return view('home.user.information');
    }


}
